package com.example.rest;

import com.example.pojo.User;
import com.example.service.UserService;
import com.example.service.impl.UserServiceImpl;
import lombok.RequiredArgsConstructor;
import lombok.extern.java.Log;
import org.springframework.stereotype.Repository;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 *
 * </p>
 *
 * @author: rch
 * @since: 2020-07-18
 */
@RestController
@RequiredArgsConstructor
@RequestMapping("api/user")
public class UserController {

    @Resource
    private UserService userService;

    /**新增用户
     * @return
     */
    @GetMapping("/save")
    public void save() {

        User user = new User();
        user.setId(1283392401458618383L);
        user.setName("Helen21231");
        user.setAge(19);
        user.setEmail("733211@qq123.com");
        boolean result = userService.saveOrUpdate(user);
        System.out.println(result);
        System.out.println(user);

    }
}
